package org.springbus.ff;

import org.springbus.ff.animate.FFAnimation;
import org.springbus.ff.conf.FFBaseConf;
import org.springbus.ff.filter.Pos;
import org.springbus.ff.node.FFImage;
import org.springbus.ff.node.FFScene;
import org.springbus.ff.node.FFText;
import org.springbus.ff.util.Path;

public class MainApp {
    public static void main(String[] args) {
        String __dirname = "D:/all_project/codeup/ffcreate_-lite/src/main/resources";
        String move_img = Path.join(__dirname, "/assets/imgs/bb.png");
        String bg1 = Path.join(__dirname, "/assets/imgs/wallp/02.jpeg");
        String bg2 = Path.join(__dirname, "/assets/imgs/wallp/04.jpeg");
        String font1 = Path.join(__dirname, "/assets/font/ysst.ttf");
        String font2 = Path.join(__dirname, "/assets/font/jdnt.ttf");
        String audio = Path.join(__dirname, "/assets/audio/02.wav");
        String outputDir = Path.join(__dirname, "/output/");
        String cacheDir = Path.join(__dirname, "/cache/");
        FFBaseConf conf = new FFBaseConf();
        conf.setCacheDir(cacheDir);
        conf.setOutputDir(outputDir);
        conf.setWidth(720);
        conf.setHeight(1280);
        conf.setLog(true);
        conf.setDebug(true);
        conf.setAudio(audio);

        // create creator instance
        FFCreator creator = new FFCreator(conf);

        FFBaseConf cf = new FFBaseConf();
        cf.setText("java home");
        cf.setX(0);
        cf.setY(100);
        cf.setFontfile("D:/all_project/codeup/ffcreate_-lite/src/main/resources/assets/font/jdnt.ttf");

        // scene2
        FFScene scene2 = new FFScene(conf);
        FFText txt = new FFText(cf);

        FFBaseConf imgConf = new FFBaseConf();
        imgConf.setPath(move_img);
        imgConf.setX(0);
        imgConf.setY(200);
        imgConf.setWidth(720);

        FFImage mo_img = new FFImage(imgConf);
        mo_img.addEffect("moveingUp", 30f, 0f);
        FFBaseConf c=new FFBaseConf();

        c.setType("move");
        c.setShowType("in");
        c.setMoveFrom(new Pos(100,700));
        c.setMoveTo(new Pos(100,100));
        c.setTime(3f);
        c.setDelay(2f);
        txt.addAnimate(new FFAnimation(c));
        scene2.addChild(mo_img);
        scene2.addChild(txt);
        scene2.setBgColor("#b33771");


        scene2.setDuration(30);
        creator.addChild(scene2);

        // creator.openLog();
        FFCreatorCenter.addTask(creator);
    }
}
